class CocoaPlantRenderer : public IBlockRenderer
{
public:
	ITexture *Texture;

	CocoaPlantRenderer(ITexture *texture) :
		Texture(texture)
	{
	}

	int GetTypeData(const int &data) { return data; }

	void Render(Schematic *schematic, RendererBase *renderer, const Block &block, const Point3i &position)
	{
		byte size = (block.Data & 0x4) != 0 ? 1 : (block.Data & 0x08) != 0 ? 2 : 0;
		byte dir = block.Data & ~(0x08 | 0x04);
		
		renderer->Translate(8, 8, 8);
		switch (dir)
		{
		case 0:
			renderer->Rotate(180, 0, 1, 0);
			break;
		case 1:
			renderer->Rotate(90, 0, 1, 0);
			break;
		case 3:
			renderer->Rotate(-90, 0, 1, 0);
			break;
		}
		renderer->Translate(-8, -8, -8);

		renderer->Draw(Face(Point3f(8, 0, 4), Point3f(8, 0, 0), Point3f(8, 4, 0), Point3f(8, 4, 4), Colorb::White, Texture, Point2i((10 - size) * 16 + 12, 10 * 16), 4, 4), true);

		switch (size)
		{
		case 0:
			renderer->Draw(Box(Texture, Point3i(4, 5, 4), Point3i(6, 4, 1)).SetAll(Point2i(10 * 16 + 11, 10 * 16 + 4)).SetTop(Point2i(10 * 16, 10 * 16)).SetBottom(Point2i(10 * 16, 10 * 16)));
			break;
		case 1:
			renderer->Draw(Box(Texture, Point3i(6, 7, 6), Point3i(5, 4, 1)).SetAll(Point2i(9 * 16 + 9, 10 * 16 + 4)).SetTop(Point2i(9 * 16, 10 * 16)).SetBottom(Point2i(9 * 16, 10 * 16)));
			break;
		case 2:
			renderer->Draw(Box(Texture, Point3i(8, 9, 8), Point3i(4, 4, 1)).SetAll(Point2i(8 * 16 + 7, 10 * 16 + 4)).SetTop(Point2i(8 * 16 + 7, 10 * 16 + 5)).SetBottom(Point2i(8 * 16 + 7, 10 * 16 + 5)));
			break;
		}
	}
};